package org.raymond.iworks.study.basic.designpattern.observer;

import lombok.Getter;

/**
 * @author raymond
 * @version V1.0
 * @Description: TODO
 */
@Getter
public class WeatherData {
    private float temperature;
    private float pressure;
    private float humidity;
    private CurrentConditions currentConditions;
    public WeatherData(CurrentConditions currentConditions){
        this.currentConditions = currentConditions;
    }
    public void dataChange(){
        currentConditions.update(temperature, pressure, humidity);
    }

    public void setData(float temperature, float pressure, float humidity){
        this.temperature = temperature;
        this.pressure = pressure;
        this.humidity = humidity;
        dataChange();
    }
}

